<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head th:replace="fragments/header :: common_header(~{::title}, ~{}, ~{::script})">
    <title>部门管理</title>

    <!-- My JavaScript -->
    <script src="../../static/app/sys/deptlist.js" th:src="@{/app/sys/deptlist.js}"></script>
</head>

<body class="easyui-layout" data-options="fit:true" style="margin:2px;">

<!--<div data-options="region:'north',title:'部门查询',hideCollapsedContent:false"
     style="height:100px;padding:5px 0;">
    <form id="searchForm" method="POST" class="search-form">
        <div class="form-item">
            <label class="label-top">名称：
                <input id="sf_name" name="name" class="easyui-textbox"/>
            </label>
        </div>
        <div class="form-item">
            <label class="label-top">上级部门：
                <select id="sf_parentId" name="parentId" class="easyui-textbox"></select>
            </label>
        </div>
        <div class="form-item">
            <a href="#" id="searchBtn" class="easyui-linkbutton primary" iconCls="e-icon fa fa-search">查询</a>
            <a href="#" id="resetBtn" class="easyui-linkbutton" iconCls="e-icon fa fa-repeat">重置</a>
        </div>
    </form>
</div>-->
<div data-options="region:'center'">
    <table id="deptGrid" data-options="toolbar:'#deptGrid-toolbar',border:false"></table>
</div>

<!-- toolbar -->
<div id="deptGrid-toolbar" style="padding:5px;"><!-- 上 右 下 左  -->
    <a href="javascript:;" class="easyui-linkbutton" plain="true" permission="sys:dept:add"
       iconCls="fa fa-plus" onclick="add()">添加</a>
    <a href="javascript:;" class="easyui-linkbutton" plain="true" iconCls="fa fa-refresh" onclick="searchGrid()">刷新</a>
    <a href="javascript:;" class="easyui-linkbutton" plain="true" iconCls="fa fa-expand"
       onclick="$grid.treegrid('expandAll')">展开</a>
    <a href="javascript:;" class="easyui-linkbutton" plain="true" iconCls="fa fa-compress"
       onclick="$grid.treegrid('collapseAll')">收起</a>
    <!--<a href="#" class="easyui-linkbutton" plain="true" iconCls="fa fa-trash" onclick="deletes()">删除</a>-->
    <span style="color: green;">右击显示上下文菜单</span>
</div>

<div id="cm" class="easyui-menu" style="width: 120px; display: none;">
    <div permission="sys:dept:add" onclick="addSameLevel();">添加同级部门</div>
    <div permission="sys:dept:add" onclick="addDownLevel();">添加下级部门</div>
    <div permission="sys:dept:update" onclick="update();" data-options="iconCls:'fa fa-edit'">修改</div>
</div>

<div id="dlg" class="easyui-dialog" data-options="title:'',width:650,height:380,closed:true">
    <form id="fm" class="dlg-form" method="POST">
        <input id="fm_id" name="id" type="hidden"/>
        <fieldset>
            <legend>部门信息</legend>
            <div class="form-row">
                <div class="form-item">
                    <label class="label-top">名称：</label>
                    <input id="fm_name" name="name" class="easyui-validatebox easyui-textbox" prompt="请输入名称"
                           data-options="required:true,validType:'byteLength[2,20]'"/>
                </div>
                <div class="form-item">
                    <label class="label-top">父部门：</label>
                    <select id="fm_parentId" name="parentId" class="easyui-combotree" data-options="panelWidth:250">
                    </select>
                </div>
            </div>
            <div class="form-row">
                <div class="form-item">
                    <label class="label-top">顺序：</label>
                    <input id="fm_seq" name="seq" class="easyui-validatebox easyui-numberbox" required="true"/>
                </div>
            </div>
            <div class="form-row">
                <div class="form-item" style="width:100%;">
                    <label class="label-top">备注：</label>
                    <input id="fm_remark" name="remark" class="easyui-validatebox easyui-textbox"
                           data-options="height:60,multiline:true" style="width: 460px;"/>
                </div>
            </div>
        </fieldset>
    </form>
</div>

<div th:replace="~{fragments/footer :: footer}">...</div>
<!-- My JavaScript -->

</body>
</html>
